﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<CodeCamp.Models.Schedule.ScheduleRoomsViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%= Html.Encode( Model.EventDisplayName ) %> | Schedule by Room
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

  <h2><%= Html.Encode( Model.EventDisplayName ) %> Schedule by Room</h2>
  <p>
    View the <%= Html.ActionLink( "Agenda", "Agenda" ) %> to see <%= Html.Encode( Model.EventDisplayName ) %> at a glance.
    View the <%= Html.ActionLink( "Session Schedule", "Index" ) %> to see the schedule arranged chronologically.
  </p>
<%--  <p>
    Download the printable <a href="/Content/2010/PortlandCodeCamp2010Schedule.pdf">Session Schedule</a> (PDF).
  </p>
--%>  <p>
    Details are subject to change. But you already knew that.
  </p>

  <h3>Saturday, June 2, 2012</h3>
  <table class="scheduleByRoom">
    <tr class="horizontalLayout">
      <td class="col1"></td>
      <td class="col2"></td>
      <td class="col3"></td>
      <td class="col4"></td>
    </tr>
    <% foreach ( var building in Model.Buildings )
       {
         foreach ( var room in building.Rooms )
         {
           if ( room.Sessions.Count > 0 )
           { %>
              <tr class="roomRow">
                <td colspan="4"><%= Html.ActionLink( string.Format( "{0}, {1}", building.Name, room.Name ), "Room", new { id = room.RoomId }, null )%></td>
              </tr>
              <% foreach ( var session in room.Sessions )
                 { %>
                    <tr class="sessionRow">
                      <td></td>
                      <td class="time">
                        <%= Html.Encode( session.StartTime.ToShortTimeString() )%> &ndash;
                        <%= Html.Encode( session.EndTime.ToShortTimeString() )%>
                      </td>
                      <td class="session"><%= Html.ActionLink( session.Title, "Details", "Sessions", new { id = session.SessionId }, null )%></td>
                      <td class="presenters">
                        <%  bool firstPresenter = true;
                            foreach ( var presenter in session.Presenters )
                            {
                              if ( !firstPresenter )
                              { %>, <% }
                              firstPresenter = false;
                              %><%= Html.ActionLink( presenter.Name, "Details", "Presenters", new { id = presenter.PresenterId }, null )%><% } %>
                      </td>
                    </tr>
              <% }
           }
         }
      } %>
  </table>

</asp:Content>

